package com.ly.heart.domain.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

import java.util.Date;

/**
 * 流程模型返回Vo
 * @author cxl
 */
@Data
@Accessors(chain = true)
public class ActModelVo{

    @ApiModelProperty ("id")
    private String id;

    @ApiModelProperty ("流程编码")
    private String code;

    @ApiModelProperty ("流程名称")
    private String name;

    @ApiModelProperty ("版本信息")
    private Integer version;

    @ApiModelProperty ("排序")
    private Integer sort;

    @ApiModelProperty ("分组ID")
    private String groupId;

    @ApiModelProperty ("分组名称")
    private String groupName;

    @ApiModelProperty ("备注")
    private String remark;

    @ApiModelProperty ("流程对象")
    private String modelData;

    @ApiModelProperty ("表单对象")
    private String formData;

    @ApiModelProperty ("流程部署对象id( act_re_procdef表id)")
    private String processDefId;

    @ApiModelProperty ("部署id( act_re_deployment表 id)")
    private String deployId;

    @ApiModelProperty ("流程实例状态（1激活 2挂起）")
    private Integer state;

    @ApiModelProperty ("状态名称")
    private String stateName;

    @ApiModelProperty ("创建时间")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    @ApiModelProperty ("修改时间")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private Date changeTime;

    public ActModelVo setStateName(Integer state){
        switch (state){
            case 1:
                stateName = "激活";
                break;
            case 2:
                stateName = "停用";
                break;
        }
        this.state = state;
        return this;
    }



}
